package com.m3958.logcollector.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.security.access.annotation.Secured;

import com.m3958.logcollector.domain.Role;
import com.m3958.logcollector.vo.RoleNames;


@RepositoryRestResource(collectionResourceRel = "roles", path = "roles")
public interface RoleRepository  extends JpaRepository<Role, Long>, RoleRepositoryCustom, JpaSpecificationExecutor<Role> {
    Role findByName(String rn);
    
    @Override
    @Secured(RoleNames.ROLE_CREATOR)
    <S extends Role> S save(S entity);
}
